﻿// Write a program that reads a string, reverses it and prints the result at the console.
// Example: "sample" -> "elpmas".

using System;

public class ReverseString
{
    public static void Main()
    {
        Console.Write("Enter some text : ");
        string inputText = Console.ReadLine();

        Console.WriteLine();
        Console.WriteLine("Reversed text is: {0}", Reverse(inputText));
    }

    public static string Reverse(string str)
    {
        char[] array = str.ToCharArray();
        Array.Reverse(array);

        return new string(array);
    }
}